<?php 

###########################################################################
#   Copyright (C) 2012 CDNPAL LTD by Christopher Gu                       #
#   resources@cdnpal.com                                                  #
#                                                                         #
#   coded for Php 4.3/5.X and above                                       #
#   and AllowOverride all for .htaccess                                   #
#                                                                         #
#   This program is free software released                                #
#   under the GPL version 2 license:                                      #
#   http://www.gnu.org/licenses/gpl-2.0.htm                               #
#                                                                         #
#   This program is distributed WITHOUT ANY WARRANTY                      #
#   or FITNESS FOR A PARTICULAR PURPOSE.                                  #
#                                                                         #
#   DADF-SDK                                                              #
#                                                                         #
###########################################################################

class TimeUtils {
	
	public static function xml_date_to_mysql_date($xml_date) {

		$timestamp = strtotime($xml_date);
		return date("Y-m-d H:i:s", $timestamp);
	}
	
	public static function mysql_date_to_xml_date($mysql_date) {

		$timestamp = strtotime($mysql_date);
		return date("Y-m-d\TH:i:s", $timestamp);
	}
	
};